package com.jlu.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope //这个注解的作用是不用重启服务便可以将scope域中的信息刷新成最新的 修改为配置后发送curl -X POST http://localhost:8990/actuator/refresh
public class DemoController {

  private static final Logger LOGGER = LoggerFactory.getLogger(DemoController.class);


  @Value("${name}")
  private String name;

  @GetMapping("demo")
  public String demo(){

    LOGGER.info("demo is ok!!!");
    return "demo is ok!!! " + "我爱" + name;
  }
}
